<?php
apf_require_class('APF_Controller');
apf_require_class('Util_BaseUrls');
apf_require_class('Const_Tip');
apf_require_class('Const_Flow');
class Qa_Error_ShowTipsController extends APF_Controller {

    public function handle_request() {
        $apf = APF::get_instance()->get_request();
        $params = $apf->get_parameters();
        $status = isset($params['status']) ? intval($params['status']) : 0;
        $code   = !empty($params['code']) ? $params['code'] : 'ERROR_SYSTEM';
        $next   = !empty($params['next']) ? base64_decode($params['next']) : Util_BaseUrls::build_base_url();

        $data = array('status' =>$status, 'tip' => Const_Tip::get_tip($code), 'next' => $next);
        $apf->set_attribute('data', $data);

        return "Qa_Error_ShowTips";
    }
}